/*
	Aiviki Javascript library 
	
	Mask

	version : 0.1
	
	http://www.aiviki.com/ajs

	By RolandShiue

	07/11/16
*/
_import("aiviki.util");	

aiviki.ui.mask =function()
	{
	var element=null;
	return {
		visible:false,
		element:null,
		opacity:0.5,
		bgcolor:"#000000",
		isVisible:function()
			{
			return this.visible;
			},
	setOpacity:function(a)
		{
			this.opacity=a;
		},
	getOpactiry:function()
		{
			return this.opacity;
		},
	close:function()
		{
		this.element.parentNode.removeChild(this.element);
		this.element=null;
		},
	show:function()
			{

			if(this.element==null)
				{
				var ps = aiviki.util.getPgsize();
				var entity = document.createElement("div");
			//	aiviki.event.addEventByObj(this.UIID,mo,"mouseout",this.mouseout,this);
				entity.id="aivikiMask";
				entity.style.position="absolute";			
				entity.style.height=ps[1]+"px";
				entity.style.width=ps[0]+"px";
				entity.style.left="0px";
				entity.style.top="0px";
				entity.style.background=this.bgcolor;
			if(isIE)
				{
				entity.style.filter="alpha(opacity="+this.opacity*100+")";
				}else{
				entity.style.opacity=this.opacity;					
				}
				document.body.appendChild(entity);
				this.element=entity;
				}

			}
		};
	}();
